public class Test_1 {
    public static  void  texctException(int a){
        if(a==0){
            throw  new ArithmeticException();
        }
    }
    public static void function()throws ArrayIndexOutOfBoundsException {
        int[] arrays = {1, 2, 3, 4};
        try {
            System.out.println(arrays[100]);
        }
        catch (ArrayIndexOutOfBoundsException e){
            System.out.println("数组越界异常处理中.......");
            e.printStackTrace();
        }
        catch(Exception e){
            System.out.println("越界异常处理中.......");
            e.printStackTrace();
        }
        System.out.println("over");
    }

    public static int finallException(){
        try {
            return 100;
        }
        catch (ArrayIndexOutOfBoundsException e){
            System.out.println("数组越界异常处理中.......");
            e.printStackTrace();
        }
        finally {
            return 10;
        }

    }
    public static void main(String[] args) throws ArrayIndexOutOfBoundsException{
   function();
//        System.out.println(finallException());


    }
    public static void main0(String[] args) throws ArithmeticException{
        texctException(0);
    }
}
